package top.txl.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.txl.Dto.WechatUserDO;
import top.txl.entity.WeUser;
import top.txl.mapper.LoginMapper;
import top.txl.service.LoginService;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public WechatUserDO findUser(String openId) {
        WechatUserDO user = loginMapper.getUser(openId);
        return user;
    }

    @Override
    public void save(WechatUserDO user) {
        loginMapper.saveUser(user);
    }

    @Override
    public Integer findUserByToken(String jwt) {
        Integer id = loginMapper.findUserByToken(jwt);
        return id;
    }
}
